# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=multitail
pkgver=6.5.1
pkgrel=0
pkgdesc="MultiTail lets you view one or multiple files like the original tail program"
arch="all"
url="http://www.vanheusden.com/multitail"
license="GPL-2.0"
depends="ncurses coreutils"
makedepends="ncurses-dev"
subpackages="$pkgname-doc"
source="https://github.com/halturin/multitail/archive/v$pkgver/multitail-$pkgver.tar.gz
	linux-is-not-debian-ncurses.patch
	install-docs.patch
	"
options="!check" # no tests provided

prepare() {
	default_prepare

	echo "VERSION=$pkgver" > version
}

build() {
	make
}

package() {
	make DESTDIR="$pkgdir" PREFIX=/usr install

	mkdir -p "$pkgdir"/etc

	mv "$pkgdir"/usr/share/doc/$pkgname-$pkgver \
		"$pkgdir"/usr/share/doc/$pkgname
	mv "$pkgdir"/usr/etc/multitail \
		"$pkgdir"/usr/share/doc/$pkgname/examples
	mv "$pkgdir"/usr/etc/$pkgname.conf.new "$pkgdir"/etc/$pkgname.conf

	rmdir "$pkgdir"/usr/etc
}

sha512sums="
7e535c20e6038d7b543fda8f0321d78ccaa23d569d8984ff1909c1750024f6192fb9ff3d14db7e1663910f5d0b239f1a26387b26c757a3b92b70a4a37aab3af7  multitail-6.5.1.tar.gz
8f9a02b37187af204a1b00646e9657ead1c70bb1f3ee9dda922186b24060f5e9bd9d7d3cfe7f29ccbc242ff69a515e010b11d51c41112ca77acd910e2de2e9db  linux-is-not-debian-ncurses.patch
1484b75f643c90c24e1609496b8642fca558109822242e12a4b18ff5ac1500c8e4fa3af787ee0c5b32a70397e176e206806e6543c8c80027716eaf93166d8c95  install-docs.patch
"
